﻿Public Class dsBXHUI
    Dim ctx As New QLDBDataContext
    Dim _clb As New dsCLB
    Private _doiBong As String
    Private _diem As Integer
    Public Sub New()
        _doiBong = ""
        _diem = 0
    End Sub
    Public Property DoiBong() As String
        Get
            Return _doiBong
        End Get
        Set(value As String)
            _doiBong = value
        End Set
    End Property
    Public Property Diem() As Integer
        Get
            Return _diem
        End Get
        Set(value As Integer)
            _diem = value
        End Set
    End Property
    Public Function SapXep(ByVal ds As List(Of dsBXHUI)) As List(Of dsBXHUI)
        Dim tam As dsBXHUI
        For i = 0 To 19
            For j = 0 To 19
                If ds(i).Diem > ds(j).Diem Then
                    tam = ds(i)
                    ds(i) = ds(j)
                    ds(j) = tam
                End If

            Next

        Next
        Return ds
    End Function
    Public Function LoadBXHUI() As List(Of dsBXHUI)
        Dim query = From p In ctx.BANGXHs
                    Select New dsBXHUI With {.DoiBong = _clb.LayTenDoiBong(p.MaCLB), .Diem = p.Diem}

        Return query.ToList()

    End Function
End Class
